Skip to content

Add transformSource hook for counterfactual catalog queries - #95

Merged
wch merged 2 commits into
mainfrom
aws-bedrock-fixes
Aug 27, 2026
Merged

Add transformSource hook for counterfactual catalog queries#95
wch merged 2 commits into
mainfrom
aws-bedrock-fixes

Conversation

@wch

@wch wch commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

A consumer that needs to answer "what would the resolved catalog look like without this configuration layer?" has no way to ask it. The Posit Assistant monorepo's Bedrock disconnect flow needs exactly this: when environment variables or admin configuration would keep a provider connected after the user's own settings are cleared, the clear action must say so — but answering meant re-implementing source precedence by hand, which drifts from the real loader.

loadProviderCatalogReport now accepts an optional transformSource hook that is applied to every loaded source (file, environment fragments, legacy settings) before resolution. A counterfactual query reuses the exact source options of the live load — same paths, environment variables, and legacy channels — and simply rewrites the sources in flight.

The hook is load-path only; watch paths never apply it. This PR also updates the memory-bank guidance on BEDROCK_DEFAULTS: credential synthesis in the monorepo no longer applies the implicit us-east-1 fallback (synthesis is now gated on catalog auth readiness, which requires deliberate region configuration), and adding Bedrock to the defaults map would now make every install fetch Bedrock models.

Consumed by the assistant monorepo's AWS sign-in branch (https://github.com/posit-dev/assistant/pull/2243), which uses the hook for its clear-confirmation counterfactual.

@wch
wch merged commit 8c6952f into main Aug 27, 2026
4 checks passed
@wch
wch deleted the aws-bedrock-fixes branch August 27, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant